/**
 *Copyright (c) 2024 watereyes
 * safetymanagement is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.system.discrete;


public enum BusinessManipulation {
    OTHER(0, "其它"),

    INSERT(1, "新增"),

    UPDATE(2, "修改"),

    DELETE(3, "删除"),

    //授权
    GRANT(4, "授权"),

    //导出
    EXPORT(5, "导出"),

    //导入
    IMPORT(6, "导入"),

    //强退
    FORCE(7, "强退"),

    //清空
    CLEAN(8, "清空"),

    CONFIRM(9, "确认"),

    ;

    private final int val;
    private final String description;

    public int getVal() {
        return val;
    }

    public String getDescription() {
        return description;
    }
    BusinessManipulation(int val, String description) {
        this.val = val;
        this.description = description;
    }

    public static BusinessManipulation valueOf(int value) {
        return switch (value) {
            case 0 -> OTHER;
            case 1 -> INSERT;
            case 2 -> UPDATE;
            case 3 -> DELETE;
            case 4 -> GRANT;
            case 5 -> EXPORT;
            case 6 -> IMPORT;
            case 7 -> FORCE;
            case 8 -> CLEAN;
            case 9 -> CONFIRM;
            default -> OTHER;
        };
    }

}
